<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="num"></div>
    <button id="bnt1">-</button>
    <button id="bnt2">+</button>
    <script>
        // let content = document.getElementById('num');
        let content = document.querySelector('#num');
        let bnt1 = document.getElementById('bnt1');
        let bnt2 = document.getElementById('bnt2');
        let count = 0;
        content.innerHTML = count;
        bnt1.addEventListener('click',function(){
            count -= 1;
            content.innerHTML = count;
        });
        bnt2.addEventListener('click',function(){
            count += 1;
            content.innerHTML = count;
        })
    </script>
</body>
</html>